package com.hmkj.core.mapper.operate;


import com.hmkj.common.baseMapper.GenericMapper;
import com.hmkj.core.model.operate.AgentModel;
import com.hmkj.core.model.operate.AnnounceModel;
import com.hmkj.core.po.operate.Agent;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 代理商表相关Dao接口<br>
 *
 * @author bin
 * @date   2017-11-07 02:41:04
 */
public interface AgentMapper extends GenericMapper<Agent,Integer> {

    @Select("SELECT t.* FROM biz_agent t WHERE 1=1 ${whereSql} ${sortSql} limit ${nowPage}, ${pageSize} ")
    List<AgentModel> findListBySqlJoin(Map<String, Object> params);

    @Select("SELECT count(1) FROM biz_agent t WHERE 1=1 ${whereSql}")
    long countBySqlJoin(Map<String, Object> params);



    @Select("SELECT t.*  FROM biz_agent t WHERE 1=1 AND t.`status` = #{status} AND t.domain = #{domain} and t.del_flag = 1")
    Agent selectAgentByDomain(@Param(value = "status") Integer status,@Param(value = "domain") String domain);

}
